From 4565fb811d5eeaed34c870ec193050ed45ea6aeb Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 13 Jun 2008 09:56:49 +0100 Subject: [PATCH] hvm: Fix max_mapped_pfn when using 2MB super pages. Fixes booting Linux guest allocated more than 4G memory. - The p2m table will track the max_mapped_pfn, and while doing p2m_gfn_to_mfn(), if the gfn is higher than max_mapped_pfn, the function will return _mfn(INVALID_MFN). This makes the Linux guest kernel panic. Signed-off-by: Xu Dongxiao --- xen/arch/x86/mm/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 9311bde126..dba676d57a 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -323,7 +323,7 @@ p2m_set_entry(struct domain *d, unsigned long gfn, mfn_t mfn, /* Track the highest gfn for which we have ever had a valid mapping */ if ( mfn_valid(mfn) && (gfn > d->arch.p2m->max_mapped_pfn) ) - d->arch.p2m->max_mapped_pfn = gfn; + d->arch.p2m->max_mapped_pfn = gfn + (1UL << page_order) - 1; if ( iommu_enabled && (is_hvm_domain(d) || need_iommu(d)) ) { -- 2.30.2